package cn.iocoder.yudao.module.promotion.dal.mysql.prizedraw;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.controller.admin.prizedraw.vo.PrizeDrawAwardsRecordPageReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.prizedraw.PrizeDrawAwardsRecordDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 抽奖活动奖品记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PrizeDrawAwardsRecordMapper extends BaseMapperX<PrizeDrawAwardsRecordDO> {

    default PageResult<PrizeDrawAwardsRecordDO> selectPage(PrizeDrawAwardsRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PrizeDrawAwardsRecordDO>()
                .eqIfPresent(PrizeDrawAwardsRecordDO::getPrizeDrawId, reqVO.getPrizeDrawId())
                .betweenIfPresent(PrizeDrawAwardsRecordDO::getRecordDate, reqVO.getRecordDate())
                .eqIfPresent(PrizeDrawAwardsRecordDO::getAwardContent, reqVO.getAwardContent())
                .betweenIfPresent(PrizeDrawAwardsRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PrizeDrawAwardsRecordDO::getPrizeDrawAwardsRecordId));
    }

}